<?php
/* Custom API function to extract all products configoptions from tblproducts */
$resource_id = mysql_query("SELECT * FROM tblpricing");
$rows = mysql_num_rows($resource_id);
$xml = array();
$xml[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$xml[] = "<whmcsapi version=\"5.1.3\">\n";
$xml[] = "<action>getpriceforQuota</action>\n";
if( $rows !== 0) {
$xml[] = "<result>success</result>\n";
$xml[] = "<products>";
while( $row = mysql_fetch_assoc($resource_id) ) {
$xml[] = "<type>{$row['type']}</type>";
$xml[] = "<currency>{$row['currency']}</currency>";
$xml[] = "<relid>{$row['relid']}</relid>";
$xml[] = "<msetupfee>{$row['msetupfee']}</msetupfee>";
$xml[] = "<qsetupfee>{$row['qsetupfee']}</qsetupfee>";
$xml[] = "<ssetupfee>{$row['ssetupfee']}</ssetupfee>";
$xml[] = "<asetupfee>{$row['asetupfee']}</asetupfee>";
$xml[] = "<bsetupfee>{$row['bsetupfee']}</bsetupfee>";
$xml[] = "<tsetupfee>{$row['tsetupfee']}</tsetupfee>";
//and all the stuff you want to get from tblproducts records
}
$xml[] = "</products>";
} else {
$xml[] = "<result>error</result>";
$xml[] = "<message>No Product Found.</message>";
}
$xml[] = "</whmcsapi>";
echo join("\n", $xml);
?>